import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SWrestleShopBuyRecords } from "../../../../../Message/Public/SWrestleShopBuyRecords";
import { ArenaShopBuyLimitInfo } from "../../../view/shop/info/ArenaShopBuyLimitInfo";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class WrestleShopBuyRecordCommand
    
    export  class WrestleShopBuyRecordCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc3=null;
            super.call(arg1);
            var loc1=arg1.messageBase as SWrestleShopBuyRecords;
            var loc2=_cache.shop.arenaShopBuyLimitInfo;
            loc2.mark = loc1.mark;
            var loc4=0;
            var loc5=loc1.records;
            for(loc3 of loc5) 
            {
                loc2.updateBuyLimit(loc3.itemCode, loc3.buyNum, ArenaShopBuyLimitInfo.KEY_NUM);
            }
            NetDispatcher.dispatchCmd(ServerCommand.WrestleShopBuyRecordCommand, loc2);
            return;
        }
    }
